package com.shenghua.utils.constants;

import com.shenghua.utils.StringUtils;

/**
 * Created by Administrator on 2019/4/14.
 */
public enum OperateType {

    ADD("add","新增"),
    DEL("del","删除"),
    EDIT("edit","编辑"),
    QUERY("query","查询"),
    GET_PAGE("getPage", "访问页面")
    ;

    public String type;
    public String desc;

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    private OperateType(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }
    private OperateType(){}

    public static boolean isOperateType(String type) {
        if(StringUtils.isNotBlank(type) && (
                type.equals(ADD.getType()) ||
                        type.equals(DEL.getType()) ||
                        type.equals(EDIT.getType()) ||
                        type.equals(QUERY.getType())
                )) {
            return true;
        }
        return false;
    }
}
